"use strict";

module.exports = (app) => {
  const { INTEGER, STRING, DATE, TEXT } = app.Sequelize;
  const User = app.model.define(
    "user",
    {
      id: { autoIncrement: true, primaryKey: true, type: INTEGER },
      project: STRING,
      env: STRING,
      msg: STRING,
      url: STRING,
      line: STRING,
      col: STRING,
      error: TEXT,

      created_at: DATE,
      updated_at: DATE,
    },
    // 表名保持一致
    { freezeTableName: true }
  );

  return User;
};
